package com.repair.project.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.repair.project.config.R;
import com.repair.project.entity.Announce;
import com.repair.project.entity.Comment;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hz
 * @since 2021-01-09
 */
@RestController
@RequestMapping("/project/comment")
public class CommentController {

//    @ApiOperation("接口描述：获取评论列表")
//    @GetMapping("getComList")
//    public R getComList(@RequestParam(value = "page")int page, @RequestParam(value = "limit")int limit,
//                        @RequestParam(required = false, value = "commentid")Integer commentid,
//                        @RequestParam(required = false, value = "stuid")Integer stuid,
//                        @RequestParam(required = false, value = "workerid")Integer workerid){
//
//        List<Comment> comments =announceService.list(null);
//        Page<Announce> announcePage = new Page<>(page, limit);
//
//        QueryWrapper<Announce> objectQueryWrapper = new QueryWrapper<>();
//        if(statu!=null && statu!="") {
//            objectQueryWrapper.eq("statu", statu);
//        }
//        if(announceid!=null) {
//            objectQueryWrapper.eq("announceid", announceid);
//        }
//        IPage<Announce> announceIPage = announceService.page(announcePage, objectQueryWrapper);
//        return R.ok().data("datalist",announceIPage);
//    }
//
//    @ApiOperation("接口描述:增加公告")
//    @PostMapping("addAnc")
//    public R addAnc(@RequestBody Announce announce){
//        return R.ok().data("data",announceService.save(announce));
//    }
//
//    @ApiOperation("接口描述：删除公告")
//    @GetMapping("delAnc")
//    public R delAnc(@RequestParam(value = "announceid")int announceid){
//        return R.ok().data("data",announceService.removeById(announceid));
//    }
//
//    @ApiOperation("接口描述：更新公告")
//    @PostMapping("updAnc")
//    public R updAnc(@RequestBody Announce announce){
//        return R.ok().data("data",announceService.updateById(announce));
//    }






}

